約 4,277,773 件
https://w.atwiki.jp/snesspec/pages/103.html
CMP (Compare Accumulator with Memory) [アキュームレータとメモリ比較] アキュームレータとメモリを比較し、 その結果に応じてステータスレジスタの内容を変更する。 アキュームレータとメモリの内容は変更されない。 比較には減算が利用される (アキュームレータ - メモリの値)。 16 ビットアキュームレータモードの時 (m=0)、 16 ビット幅でデータを扱う。 下位バイトは実効アドレスに、上位バイトは実効アドレス + 1 に入れる。 フラグ変化 n-----zc n 結果の最上位ビットの値 z 結果が 0 の時セット c ボロー (桁下がり) が必要無い時セット (アキュームレータ = メモリ) ボローが必要な時はセットしない (アキュームレータ メモリ) コード一覧 アドレッシングモード 文法 オペコード バイト数 命令サイクル 注 Immediate CMP #const C9 2* 2 1 Absolute CMP addr CD 3 4 1 Absolute Long CMP long CF 4 5 1 Direct Page CMP dp C5 2 3 1,2 Direct Page Indirect CMP (dp) D2 2 5 1,2 Direct Page Indirect Long CMP [dp] C7 2 6 1,2 Absolute Indexed,X CMP addr,X DD 3 4 1,3 Absolute Long Indexed,X CMP long,X DF 2 7 1 Absolute Indexed,Y CMP addr,Y D9 3 4 1,3 Direct Page Indexed,X CMP dp,X D5 2 4 1,2 Direct Page Indexed Indirect,X CMP (dp,X) C1 2 6 1,2 Direct Page Indirect Indexed,Y CMP (dp),Y D1 2 5 1,2,3 Direct Page Indirect Long Indexed,Y CMP [dp],Y D7 2 6 1,2 Stack Relative CMP sr,S C3 2 4 1 Stack Relative Indirect Indexed,Y CMP (sr,S),Y D3 2 7 1 * m=0 (16-bit メモリ/アキュームレータ) の時 1 バイト増加 1 m=0 (16-bit メモリ/アキュームレータ) の時 1 サイクル増加 2 ダイレクトページレジスタの下位バイトが 0 でない場合 1 サイクル増加 3 インデックスがページ境界をまたいだ場合 1 サイクル増加
https://w.atwiki.jp/mizcremorne/pages/243.html
llIntegerToBase64 string llIntegerToBase64(integer number) integer型の数値をBase64データへエンコードする。 この関数でエンコードしたデータをデコードするには、llBase64ToInteger関数を使う。 名前 コメント
https://w.atwiki.jp/thiroyoshi/pages/28.html
各プログラムではパフォーマンス等を考慮していません。 動けばよし。 outputファイルはすべてシェルスクリプトで生成しているものであって、プログラム内では標準出力しかしていません。 meantime.cpp 各outputから実行時間を取り出し、平均値を計算。その後、すべての結果をまとめて表示する。 入力:outputX (X = 00〜39) 出力:output_Y (Y = n,p) #include iostream #include string #include list #include fstream #include stdlib.h using namespace std; double todouble(string str){ return atof(str.c_str()); } int main(int argc, char *argv[]){ list string data; //計算時間を保持するリスト int n_out = atoi(argv[1]); //コマンドライン引数でファイル数を入力 for(int j = 0; j n_out; j++){ char num[2]; sprintf(num,"%d",j); //ファイル番号取得 char filename[9]; //ファイル番号に応じて入力形式を変化 if(j 10){ filename[0] = o ; filename[1] = u ; filename[2] = t ; filename[3] = p ; filename[4] = u ; filename[5] = t ; filename[6] = 0 ; filename[7] = num[0]; filename[8] = \0 ; } else if(j = 10){ filename[0] = o ; filename[1] = u ; filename[2] = t ; filename[3] = p ; filename[4] = u ; filename[5] = t ; filename[6] = num[0]; filename[7] = num[1]; filename[8] = \0 ; } cout filename endl; ifstream fs; string tmp; fs.open(filename); //ファイルオープン //outputファイルの仕様に応じて、必要な部分を保存する while(true){ getline(fs, tmp, \n ); if(tmp != "times") cout tmp endl; if(tmp == "times"){ getline(fs, tmp, \n ); cout tmp endl; data.push_back(tmp); break; } if(fs.eof()) break; } fs.close(); } //各値の出力と平均の計算 double time[n_out]; double mean = 0; cout endl; cout "times" endl; list string iterator it_d = data.begin(); for(int k = 0; k n_out; k++){ cout k " " *it_d endl; time[k] = todouble(*it_d); mean += time[k]; ++it_d; } ++it_d; mean /= n_out; cout "mean" endl; cout mean endl; return 0; } mt_cmp.cpp meantimeで作った新たなoutputを用いて、比較用の時間をまとめたファイルを作る 入力:output_Y (Y = n,p) 出力:output_cmp #include iostream #include string #include list #include fstream #include stdlib.h using namespace std; double todouble(string str){ return atof(str.c_str()); } int main(int argc, char *argv[]){ int n_out = atoi(argv[1]); list string mean; list string data_n; list string data_p; //未高速化の計算時間ファイル読み込み char filename[9]; filename[0] = o ; filename[1] = u ; filename[2] = t ; filename[3] = p ; filename[4] = u ; filename[5] = t ; filename[6] = _ ; filename[7] = n ; filename[8] = \0 ; //cout filename endl; ifstream fs;//ファイルストリーム string tmp;//データ一時保存用変数 fs.open(filename);//ファイルオープン //データの取り込み while(true){ getline(fs, tmp, \n ); //cout tmp endl; if(tmp == "times"){ for(int j = 0; j n_out; j++){ getline(fs, tmp, \n ); data_n.push_back(tmp); } } if(tmp == "mean"){ getline(fs, tmp, \n ); mean.push_back(tmp); break; } if(fs.eof()) break; } fs.close(); //高速化の計算時間ファイル読み込み filename[7] = p ; //cout filename endl; fs.open(filename);//ファイルオープン //データの取り込み while(true){ getline(fs, tmp, \n ); //cout tmp endl; if(tmp == "times"){ for(int j = 0; j n_out; j++){ getline(fs, tmp, \n ); data_p.push_back(tmp); } } if(tmp == "mean"){ getline(fs, tmp, \n ); mean.push_back(tmp); break; } if(fs.eof()) break; } fs.close(); //すべての時間を並べて出力 list string iterator it_m = mean.begin(); list string iterator it_dn = data_n.begin();//1行でのデータのリスト list string iterator it_dp = data_p.begin(); cout "output_n output_p" endl; for(int j = 0; j n_out;j++){ cout *it_dn " " *it_dp endl; ++it_dn; ++it_dp; } double n,p; cout endl; cout "mean_n " *it_m endl; n = todouble(*it_m); ++it_m; cout "mean_p " *it_m endl; p = todouble(*it_m); cout "diff " n-p endl; return 0; }
https://w.atwiki.jp/no_te/pages/28.html
宣言 Dim i As Integer 整数 Dim i As Double 倍精度実数 Dim i As String 文字列 Dim i As Object オブジェクト Dim i As Boolean ブール Dim i() As Integer 可変長配列 Dim i(3) As Integer 固定長配列 Dim i(3,4) As Integer 二次元配列 配列を引数に Function func(array() As Double) ... End Function
https://w.atwiki.jp/ce00582/pages/1913.html
Private Sub Command1_Click() Dim a1 As Single Dim a2 As Single Dim a3 As Single Dim a4 As Single Dim year As Integer Dim age As Integer Dim m(0 To 99, 0 To 99) As Single Dim f(0 To 99, 0 To 99) As Single Dim rate(10 To 99) As Single Dim kisoj(0 To 99, 65 To 99) As Single Open "c /dig/gdata/将来推計人口.txt" For Input As #1 Do Until EOF(1) Input #1, a1, a2, a3, a4 year = a1 age = a2 m(year, age) = a3 f(year, age) = a4 Loop Close #1 Dim n As Integer For year = 10 To 50 rate(year) = 1.05 - 0.05 * (year - 10) / 40 Next For year = 51 To 99 rate(year) = 1 Next For year = 10 To 99 For age = 65 To 99 kisoj(year, age) = (m(year, age) + f(year, age)) / rate(year) Next Next Open "c /dig/gdata/基礎年金受給者.txt" For Output As #2 For year = 10 To 99 For age = 65 To 99 Write #2, year, age, kisoj(year, age) Next Next Close #2 For n = 1 To 9 year = 10 * n z1 = 0 For age = 65 To 99 z1 = z1 + kisoj(year, age) Next Debug.Print year, z1 Next End Sub
https://w.atwiki.jp/ce00582/pages/81.html
Function gen(ystart As Single, m2, f2, mw, fw) As Single Dim year As Integer Dim age As Integer g1 = 0 For year = 5 To 99 age = 100 + year - ystart h = 1 If age 65 Then h = 0 If age 65 Then age = 65 If age 16 Then h = 0 If age 16 Then age = 16 g2 = rev(year, age, m2, f2, mw, fw) If h = 0 Then g2 = 0 g1 = g1 + g2 / (1 + 0.032) ^ (year - 5) Next gen = Int(g1 / 10 ^ 2) / 10 ^ 2 End Function Function rate(year As Integer) As Single Dim r1 As Single Dim y1 As Single r1 = 0.1358 y1 = year If y1 18 Then y1 = 17 If y1 4 Then y1 = 3 r1 = r1 + (y1 - 3) * 0.00354 rate = r1 End Function Function wage(sex As Integer, year As Integer, age As Integer, g As Single, mc, fc) As Single Dim n As Integer Dim mw1(0 To 99) As Single Dim fw1(0 To 99) As Single Dim y1 As Integer Dim w1 As Single mw1(5) = mc(age) * 25 fw1(5) = fc(age) * 13 For y1 = 6 To year mw1(y1) = (1 + g) * mw1(y1 - 1) fw1(y1) = (1 + g) * fw1(y1 - 1) Next If sex = 1 Then w1 = mw1(year) If sex = 2 Then w1 = fw1(year) wage = w1 End Function Function rev(year As Integer, age As Integer, m2, f2, mw, fw) As Single Dim r1 As Single Dim r2 As Single Dim r3 As Single r1 = 0 r2 = 12 * m2(year, age) * mw(year, age) r3 = 12 * f2(year, age) * fw(year, age) r1 = r1 + rate(year) * (r2 + r3) rev = r1 End Function Private Sub Command1_Click() Dim a1 As Single Dim a2 As Single Dim a3 As Single Dim a4 As Single Dim ystart As Single Dim year As Integer Dim age As Integer Dim m2(-3 To 99, 16 To 65) As Single Dim f2(-3 To 99, 16 To 65) As Single Dim mw(0 To 99, 16 To 65) As Single Dim fw(0 To 99, 16 To 65) As Single Open "c /simple/gdata/厚生年金被保険者.txt" For Input As #1 Do Until EOF(1) Input #1, a1, a2, a3, a4 year = a1 age = a2 m2(year, age) = a3 f2(year, age) = a4 Loop Close #1 n = 3 Dim mc(16 To 65) As Single Dim fc(16 To 65) As Single Open "c /simple/data/標準報酬.txt" For Input As #2 Do Until EOF(2) Input #2, a1, a2, a3 age = Int(a1) + 1 mc(age) = a2 fc(age) = a3 Loop Close #2 Dim g As Single g = 0.021 For year = 0 To 99 For age = 16 To 65 mw(year, age) = wage(1, year, age, g, mc, fc) fw(year, age) = wage(2, year, age, g, mc, fc) Next Next Open "c /simple/gdata/世代支払保険料.txt" For Output As #44 For ystart = 0 To 199 Write #44, ystart, gen(ystart, m2, f2, mw, fw) Next Close #44 For ystart = 0 To 199 Debug.Print ystart, gen(ystart, m2, f2, mw, fw) Next End Sub
https://w.atwiki.jp/mizcremorne/pages/93.html
llBase64ToInteger integer llBase64ToInteger(string str) Base64変換されたデータstrをinteger型にデコードする。 Base64というのは電子メールなどに使われるエンコードの方式である。 漢字や生データを英数字に変換する方式なので、漢字を扱えない環境などでもデータをやり取りすることができる。 例えば "隣の客はよく柿食う客だ" という文字列をBase64変換すると "ztmkzrXSpM+k6KSvs8G/qaSmtdKkwA==" のようなデータになる。 Base64変換を行うことを「Base64でエンコードする」と言い、逆にBase64変換されたデータを元に戻すことを「Base64でデコードする」と言う。 LSLにおいては 「ll*ToBase64」がエンコード系の関数、 「llBase64To*」がデコード系の関数である。 llBase64ToString、llStringToBase64?、llIntegerToBase64も参照のこと。
https://w.atwiki.jp/ce00582/pages/53.html
Function gen(m2, f2, mw, fw) As Single Dim year As Integer g1 = 0 For year = 5 To 99 g1 = g1 + 10 ^ (-4) * rev(year, m2, f2, mw, fw) / (1 + 0.032) ^ (year - 5) Next gen = g1 End Function Function rate(year As Integer) As Single Dim r1 As Single Dim y1 As Single r1 = 0.1358 y1 = year If y1 18 Then y1 = 17 If y1 4 Then y1 = 3 r1 = r1 + (y1 - 3) * 0.00354 rate = r1 End Function Function wage(sex As Integer, year As Integer, age As Integer, g As Single, mc, fc) As Single Dim n As Integer Dim mw1(0 To 99) As Single Dim fw1(0 To 99) As Single Dim y1 As Integer Dim w1 As Single mw1(5) = mc(age) * 24 fw1(5) = fc(age) * 21 For y1 = 6 To year mw1(y1) = (1 + g) * mw1(y1 - 1) fw1(y1) = (1 + g) * fw1(y1 - 1) Next If sex = 1 Then w1 = mw1(year) If sex = 2 Then w1 = fw1(year) wage = w1 End Function Function rev(year As Integer, m2, f2, mw, fw) As Single Dim r1 As Single Dim r2 As Single Dim r3 As Single Dim age As Integer r1 = 0 For age = 16 To 65 r2 = 12 * m2(year, age) * mw(year, age) r3 = 12 * f2(year, age) * fw(year, age) r1 = r1 + rate(year) * (r2 + r3) Next rev = r1 End Function Private Sub Command1_Click() Dim a1 As Single Dim a2 As Single Dim a3 As Single Dim a4 As Single Dim year As Integer Dim age As Integer Dim m2(-3 To 99, 16 To 65) As Single Dim f2(-3 To 99, 16 To 65) As Single Dim mw(0 To 99, 16 To 65) As Single Dim fw(0 To 99, 16 To 65) As Single Open "c /simple/gdata/厚生年金被保険者.txt" For Input As #1 Do Until EOF(1) Input #1, a1, a2, a3, a4 year = a1 age = a2 m2(year, age) = a3 f2(year, age) = a4 Loop Close #1 n = 3 Dim mc(16 To 65) As Single Dim fc(16 To 65) As Single Open "c /simple/data/標準報酬.txt" For Input As #2 Do Until EOF(2) Input #2, a1, a2, a3 age = Int(a1) + 1 mc(age) = a2 fc(age) = a3 Loop Close #2 Dim g As Single g = 0.021 For year = 0 To 99 For age = 16 To 65 mw(year, age) = wage(1, year, age, g, mc, fc) fw(year, age) = wage(2, year, age, g, mc, fc) Next Next Open "c /simple/gdata/支払保険料.txt" For Output As #3 For year = 0 To 99 Write #3, year, Int(rev(year, m2, f2, mw, fw) / 1000) / 10 Next Close #3 For n = 1 To 5 year = 5 * n Debug.Print Int(rev(year, m2, f2, mw, fw) * 10 ^ (-2)) * 10 ^ (-2) Next For n = 3 To 6 year = 10 * n Debug.Print Int(rev(year, m2, f2, mw, fw) * 10 ^ (-2)) * 10 ^ (-2) Next Debug.Print gen(m2, f2, mw, fw) For year = 5 To 99 Debug.Print rate(year) Next End Sub
https://w.atwiki.jp/ce00582/pages/68.html
Function su(year As Integer, m, f) As Single Dim s1 As Single Dim age As Integer s1 = 0 For age = 65 To 99 s1 = s1 + m(year, age) + f(year, age) Next su = s1 End Function Private Sub Command1_Click() Dim x As Single Dim y As Single Dim z As Single Dim p As Single Dim year As Integer Dim age As Integer Dim m(-5 To 99, 0 To 99) As Single Dim f(-5 To 99, 0 To 99) As Single Open "c /simple/gdata/将来推計人口.txt" For Input As #1 Do Until EOF(1) Input #1, x, y, z, p year = x age = y m(year, age) = z f(year, age) = p Loop Close #1 Dim n As Integer Open "c /simple/gdata/基礎年金受給者.txt" For Output As #2 For year = 0 To 99 Write #2, year, su(year, m, f) Next Close #2 For n = 1 To 5 year = 5 * n Debug.Print year, Int(su(year, m, f)) Next For n = 3 To 6 year = 10 * n Debug.Print year, Int(su(year, m, f)) Next End Sub
https://w.atwiki.jp/chaka-poko/pages/33.html
画像を縮小表示する(ASP.NET) メモ 透過GIFは透過でなくなってしまう。Bitmapに変換してから縮小しているから? テーブルのレイアウト フィールド名 データ型 id int ID(主キー 連番) subject varchar(300) 件名 title varchar(100) ファイル名 type varchar(50) MIMEタイプ idata varbinary(MAX) バイナリ・データ last_modified datetime 最終更新日 Thumbnail2.aspx html xmlns="http //www.w3.org/1999/xhtml" head runat="server" title 画像を縮小して表示(ASP.NET) /title /head body form id="form1" runat="server" h3 画像を縮小して表示 ASP.NET版 /h3 asp HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx" 戻る /asp HyperLink p 100px×100pxに収まるように比率を維持して縮小 /p asp DataList ID="DataList1" runat="server" DataKeyField="id" DataSourceID="SqlDataSource1" ItemTemplate strong id /strong asp Label ID="lblId" runat="server" Text= %# Eval("id") % /asp Label strong subject /strong asp Label ID="lblSubject" runat="server" Text= %# Eval("subject") % /asp Label br / asp Image ID="imgIdata" runat="server" CssClass="thumb" / br / hr / /ItemTemplate /asp DataList asp SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString=" %$ ConnectionStrings NetWorks01ConnectionString % " SelectCommand="SELECT [id], [subject] FROM [d_Image]" /asp SqlDataSource /form /body /html Thumbnail2.aspx.vb Partial Class ImageThumbnail_Thumbnail2 Inherits System.Web.UI.Page Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then Dim id As Label = CType(e.Item.FindControl("lblId"), Label) Dim image As Image = CType(e.Item.FindControl("imgIdata"), Image) image.ImageUrl = "Image2.aspx?id=" id.Text End If End SubEnd Class Image2.aspx ※空のページ html xmlns="http //www.w3.org/1999/xhtml" head runat="server" title 画像 /title /head body form id="form1" runat="server" div /div /form /body /html Image2.aspx.vb Imports System.Data.SqlClientImports System.Data Partial Class ImageThumbnail_Image2 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 選択されたIDの画像をDBから取り出して表示する。 Dim id As Integer id = Request.QueryString("id") Dim db As New SqlConnection(ConfigurationManager.AppSettings("dbstr")) Dim cmd As SqlCommand = New SqlCommand("SELECT type,idata FROM d_Image WHERE id=@p1", db) Dim p1 As SqlParameter = cmd.Parameters.Add("@p1", SqlDbType.Int) p1.Value = id db.Open() Dim rs As SqlDataReader = cmd.ExecuteReader() If rs.Read Then Dim oW As Integer = 100 サムネイル表示サイズ横 Dim oH As Integer = 100 サムネイル表示サイズ縦 Dim bmp As System.Drawing.Bitmap = System.Drawing.Bitmap.FromStream(New System.IO.MemoryStream(DirectCast(rs("idata"), Byte()))) If bmp.Width oW Or bmp.Height oH Then Dim s As Double = Math.Min(oW / bmp.Width, oH / bmp.Height) Dim sW As Integer = CInt(s * bmp.Width) Dim sH As Integer = CInt(s * bmp.Height) Dim outBmp As System.Drawing.Bitmap = New System.Drawing.Bitmap(sW, sH) Using g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(outBmp) g.DrawImage(bmp, 0, 0, sW, sH) End Using Response.ContentType = CType(rs("type"), String) outBmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg) Else Response.ContentType = CType(rs("type"), String) Response.BinaryWrite(DirectCast(rs("idata"), Byte())) End If Response.End() End If rs.Close() db.Close() End SubEnd Class 参考にさせていただいたページ C# と VB.NET の質問掲示板:GridViewにDBの画像を縦横比保持して縮小表示するには [Counter] Total: -